package com.hs.srm.admin.modules.pricemanagement.controller;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;








import javax.servlet.http.HttpServletRequest;

import com.hs.srm.admin.modules.pricemanagement.service.NPRODistributeViewService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import sunnykid.lang.SunnykidDate;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.hs.srm.admin.modules.pricemanagement.entity.HistoricalPriceEntity;
import com.hs.srm.admin.modules.pricemanagement.entity.InquiryQuotationEntity;
import com.hs.srm.admin.modules.pricemanagement.service.HistoricalPriceService;
import com.hs.srm.admin.modules.pricemanagement.service.InquiryQuotationService;
import com.hs.srm.admin.modules.pricemanagement.service.ParityService;
import com.hs.srm.admin.modules.pricemanagement.vo.InquiryVO;
import com.hs.srm.admin.modules.sys.controller.AbstractController;
import com.hs.srm.admin.modules.vendor.entity.VendorInfoEntity;
import com.hs.srm.base.common.annotation.SysLog;
import com.hs.srm.base.common.utils.Constant;
import com.hs.srm.base.modules.sys.entity.SysUserEntity;
import com.hs.srm.common.utils.Constants;
import com.hs.srm.common.utils.PageUtils;
import com.hs.srm.common.utils.R;
import com.landray.kmss.km.review.webservice.Exception_Exception;
import com.landray.kmss.km.review.webservice.IKmReviewWebserviceService;
import com.landray.kmss.km.review.webservice.IKmReviewWebserviceServiceService;
import com.landray.kmss.km.review.webservice.KmReviewParamterForm;

/**
 * 报价基本信息
 * @author yanfei
 *
 * @date 2019年3月11日
 */

@RestController
@RequestMapping("/historicalPrice")
public class HistoricalPriceController extends AbstractController {

	private static final long serialVersionUID = -4123823577744890422L;


	@Autowired
	private HistoricalPriceService historicalPrice;

	@Autowired
	private NPRODistributeViewService nproDistributeViewService;
	/**
	 * list 订单价格查询
	 */
	@RequestMapping("/list")
	public R list(@RequestParam Map<String, Object> params,HttpServletRequest resquest) {
		// 查询用户列表
		PageUtils page = this.historicalPrice.queryPage(params);
		return R.ok(page);
	}

	/**
	 * list 非生产性订单货源分配价格查询，供应商为正式
	 */
	@RequestMapping("/nproVendorList")
	public R nproVendorList(@RequestParam Map<String, Object> params) {
		PageUtils page = this.nproDistributeViewService.queryPage(params);
		return R.ok(page);
	}

	/**
	 * 样品订单货源分配价格查询，供应商包括正式和临时
	 */
	@RequestMapping("/sampleVendorList")
	public R sampleVendorList(@RequestParam Map<String, Object> params) {
		PageUtils page = this.nproDistributeViewService.queryUnionPage(params);
		return R.ok(page);
	}

	/**
	 * 
	 * 目前不用 (保留) 
	 */
	@SysLog("保存询价后领导同意的价格")
	@RequestMapping(value = "/saveHistPrice")
	public R saveHistPrice(HistoricalPriceEntity historicalPrice) {
		
		return R.ok();
	}

}
